package com.xcx.config;

import com.xcx.properties.AliOssProperties;
import com.xcx.utils.AliOssUtil;
import com.xcx.utils.ExcelUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: Lisa
 * @className: OssConfiguration
 * @description:
 * @date: 2023/11/18 15:59
 * @VERSION: 0.1
 * @SINCE: jdk11
 */
@Configuration
@Slf4j
public class OssConfiguration {

    @Bean
    public AliOssUtil aliOssUtil(AliOssProperties aliOssProperties) {
        AliOssUtil aliOssUtil = new AliOssUtil(aliOssProperties.getEndpoint(), aliOssProperties.getAccessKeyId(),
                aliOssProperties.getAccessKeySecret(), aliOssProperties.getBucketName());
        return aliOssUtil;
    }

    @Bean
    public ExcelUtils excelUtils() {
        return new ExcelUtils();
    }

}
